<template>
  <div class="courseCard">
    <div class="headPic">
      <img v-lazy="data.iconPath" />
    </div>
    <div class="flexBox">
      <div class="content">
        <div class="name">{{ data.name }}</div>
        <!-- <div class="courseName">{{ data.name }}</div> -->
        <div class="courseDesc">{{ data.currDesc }}</div>
      </div>
      <div class="button">
        进入管理
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {};
  },
  props: {
    data: Object,
  },
  methods: {},
};
</script>

<style lang="stylus" scoped>
.courseCard {
  // margin-right: 22px;
  margin-bottom: 20px
  cursor: pointer;
  display: flex;
  flex-flow: column;
  max-width: 285px;
  width: 285px;
  height: 320px;
  background-color: #ffffff;
  border: solid 1px #ebeef5;
  border-radius: 3px;
  transition: all 0.2s linear;

  .headPic {
    padding: 10px 15px 0;
    // width: 255px;
    height: 145px;

    img {
      object-fit: cover;
      width: 100%;
      height: 100%;
    }
  }

  .flexBox {
    flex: 1;
    display: flex;
    justify-content: space-between;
    flex-flow: column;

    .content {
      padding: 10px 15px 0;
      margin-top: 5px;

      .name {
        font-family: Source Han Sans CN;
        font-size: 20px;
        color: #303133;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
      }

      .courseName {
        margin-top: 7px;
        font-family: Source Han Sans CN;
        font-size: 14px;
        color: #909399;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
      }

      .courseDesc {
        margin-top: 7px;
        font-family: Source Han Sans CN;
        font-size: 14px;
        color: #303133;
        word-wrap: break-word;
        text-overflow: -o-ellipsis-lastline;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
      }
    }

    .button {
      cursor: pointer;
      height: 36px;
      line-height: 36px;
      background-color: #f6f6f6;
      text-align: center;
      font-family: Source Han Sans CN;
      font-size: 1rem;
      color: #303133;
    }
  }
}

.courseCard:hover {
  box-shadow: 0px 6px 18px 0px rgba(0 0 0 0.16);
}
</style>